import subprocess
import argparse


def scp_files(identity_file, local_file, remote_user, remote_host, remote_path):
    scp_command = ['scp', '-i', identity_file, local_file,
                   '{}@{}:{}'.format(remote_user, remote_host, remote_path)]
    subprocess.run(scp_command)


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('-i', required=True, dest='wjunshen.pem')
    parser.add_argument('all-minilm-l6-v2-index-100k.json', nargs=1)
    parser.add_argument('ec2-user')
    parser.add_argument('ec2-35-79-17-92.ap-northeast-1.compute.amazonaws.com')
    parser.add_argument('/home/ec2-user/workloads/all-minilm-l6-v2-100k')
    args = parser.parse_args()

# scp -i "wjunshen.pem" all-minilm-l6-v2-index-100k.json ec2-user@ec2-35-79-17-92.ap-northeast-1.compute.amazonaws.com:/home/ec2-user/workloads/all-minilm-l6-v2-100k

    scp_files(args.identity_file, args.local_file[0],
              args.remote_user, args.remote_host, args.remote_path)
